package org.lucava.boatskeeper.client.event.category;

import com.google.gwt.event.shared.GwtEvent;

public class EditCategoryEvent extends GwtEvent<CategoryHandler> {

    public static GwtEvent.Type<CategoryHandler> TYPE = new GwtEvent.Type<CategoryHandler>();
    private final Integer id;

    public EditCategoryEvent(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    @Override
    public GwtEvent.Type<CategoryHandler> getAssociatedType() {
        return TYPE;
    }

    @Override
    protected void dispatch(CategoryHandler handler) {
        handler.onEditCategory(this);
    }
}